import com.sun.awt.AWTUtilities;

import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;

public class XForm extends XTheme {


    public static void main(String[] args) throws Exception {
        prepareUI();
        JFrame frame = new JFrame("收银宝");
        frame.setJMenuBar(XMenuBar.createMenuBar());

        BufferedImage img = ImageIO.read(new File("D:\\code\\swing\\src\\images\\zhifu-yue2.png"));
        frame.setIconImage(img);

        JPanel contentPanel = new JPanel();
        Box box = XTable.createTable();

        Box hBox = Box.createHorizontalBox();
        hBox.add(XMenuBar.createJToolBar(contentPanel,box));
        hBox.add(Box.createHorizontalGlue());


        contentPanel.setLayout(new BorderLayout());
        contentPanel.add(hBox,BorderLayout.NORTH);


        contentPanel.add(box,BorderLayout.CENTER);
        frame.getContentPane().add(contentPanel);

        frame.setSize(800,600);
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        AWTUtilities.setWindowOpacity(frame,1F);
        frame.setVisible(true);
    }


    //弹窗的窗口
    static class MyDialogDemo extends JDialog{
        public MyDialogDemo() {

            this.setVisible(true);
            this.setBounds(100,100,500,500);
            //this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            Container container = this.getContentPane();
            container.setLayout(null);
            container.add(new Label("欢迎光临"));
        }
    }


}
